<?php use_helper('Text') ?>
<?php use_helper('Date') ?>

<!--Content-->
<div class="jl_top">
   <div class="home_cont3_top"><span class="ft8"><span class="ft9">全部留言</span></span></div>
</div>
<div class="ms_bottom">



<?php if(count($messages)):?>
     <!--All_message-->
     <table width="610" cellspacing="0" align="center" class="all_ms_xx">
     <?php $n = count($messages); for ($i = 0; $i < $n; $i++): ?>
				<tr<?php ($i + 1) % 2 and print ' class="odd"' ?>>
                  <td>
                    <em><?php echo format_date($messages[$i]->getCreatedAt(), 'y-M-d h:m') ?></em>
                    <span><?php echo $messages[$i]->getName() ?>:</span>
                    <p><?php echo simple_format_text($messages[$i]->getMessage()) ?></p>
                  </td>
                </tr>
	 <?php endfor ?>
     </table>
     
     <!--Page Size-->
     <div class="jl_pagesize">
<?php include_partial('allMessagePager/pager', array('pager' => $pager,'cid' =>$cid, 'route' => 'contestant_showallmessage')) ?> 
     </div>
<?php else:?>
<center>暂时还没有留言哦！</center>
<?php endif?>   
     <div class="all_ms_title">留言</div>
        <?php include_partial('Message/form', array(
          'form' => $form2,
          'contestantId' => $cid
        )) ?>
</div>